Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.13 Support #708

Merged
merged 13 commits into from
Oct 30, 2024
Merged

Python 3.13 Support #708

merged 13 commits into from
Oct 30, 2024

Conversation

benfred
Copy link
Owner

@benfred benfred commented Oct 19, 2024

Initial support for python 3.13 . This works as far as getting basic stack traces from python 3.13 programs, but there are still some remaining tasks:

@zanieb
Copy link
Contributor

zanieb commented Oct 19, 2024

Exciting! Happy to review this when it's ready, if you want.

@benfred
Copy link
Owner Author

benfred commented Oct 19, 2024

@zanieb - that would be great, I'd appreciate it! I'll ping you when its ready

@benfred benfred changed the title [WIP] Python 3.13 Support Python 3.13 Support Oct 23, 2024
@benfred benfred marked this pull request as ready for review October 23, 2024 05:48
@benfred
Copy link
Owner Author

benfred commented Oct 23, 2024

This doesn't fully handle freethreaded/nogil python interpreters - but I'm leaning towards handling that in a separate PR and getting this merged in first - tracked in #711 .

One other issue is that the f_executable pointer on the FrameObject can be any arbitrary python object in python3.13 - and not just a PyCodeObject like in older versions of python. This PR is currently just skipping frames where we can't read the filename and function name (indicating a f_executable that isn't a PyCodeObject) -but maybe should instead be checking if the f_executable->ob_type == &PyCode_Type like PyCode_Check does in cpython (?). (The downside to checking the type is that we'd have to figure out the address of PyCode_Type in the target process and pass along to the get_stack_traces function - which might be a bit difficult right now)

@zanieb fyi

@zanieb
Copy link
Contributor

zanieb commented Oct 28, 2024

Cool I'll review this week.

@benfred benfred mentioned this pull request Oct 30, 2024
4 tasks
Copy link
Contributor

@zanieb zanieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think my review is worth much, but I didn't see anything concerning.

@benfred benfred merged commit 7e76dd8 into master Oct 30, 2024
42 checks passed
@benfred benfred deleted the python_3_13 branch October 30, 2024 23:43
@benfred benfred added the enhancement New feature or request label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants